package com.javabi.codeobject.java.block.method.concurrent;

import static com.javabi.codeobject.java.block.method.concurrent.ReadWriteLockField.DEFAULT_NAME;

import java.util.concurrent.locks.Lock;

import com.javabi.codeobject.java.block.codeblock.IJavaCodeLines;
import com.javabi.codeobject.java.block.codeblock.JavaCodeLines;
import com.javabi.codeobject.java.block.method.JavaMethod;

public class GetReadLockMethod extends JavaMethod {

	public GetReadLockMethod() {
		super("getReadLock", Lock.class);
	}

	public GetReadLockMethod setDefaultContents() {
		IJavaCodeLines lines = new JavaCodeLines();
		lines.line("return " + DEFAULT_NAME + ".readLock();");
		setContents(lines);
		return this;
	}
}
